import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

// 全局的state
const state = {
  time: "999",
};

// 全局的 mutations
const mutations = {
  UPDATE_TIME: function (state) {
    state.time++;
  },
};
const actions = {
  updatetime({ commit }) {
    console.log("222");

    commit("UPDATE_TIME");
  },
};
// 全局的 getters
const getters = {};

const store = new Vuex.Store({
  state,
  mutations,
  actions,
  getters,
  modules: {
    // 其他业务更多的模块文件
  },
});

export default store;
